<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>05日期函数</title>
</head>
<body>
<script>
    var date = new Date();
    console.log(date);   //Wed Aug 30 2017 13:26:51 GMT+0800 (中国标准时间)
    console.log(date.getTime());  //1504070843457   从1970年至现在的毫秒数
    console.log(date.valueOf());  //1504070843457   跟上面的一样，但是没有上面的常用

    //直接使用
    console.log(Date.now());  //1504070966613
    console.log(+new Date());  //1504070966613
    console.log(typeof (+"123456"));  //number

    console.log(date.getFullYear());  //2017
    console.log(date.getYear());  //117
    console.log(date.getMonth());  //7
    console.log(date.getDate());  //30
    console.log(date.getDay())   //3
    console.log(date.getHours())  //14
    console.log(date.getMinutes()) //5
    console.log(date.getSeconds()) //16
    console.log(date.getMilliseconds()) //728
</script>
</body>
</html>